<template>
  <div id="app">
    <router-view />
  </div>
</template>

<script>
import { defineComponent, onMounted } from 'vue';
import { useRouter } from 'vue-router';
import { useLoginUserStore } from '@/stores/loginUser.ts'

export default defineComponent({
  name: 'App',
  setup() {
    const router = useRouter();
    const loginUserStore = useLoginUserStore()
    
    // 在组件挂载后获取登录用户信息
    onMounted(() => {
      loginUserStore.fetchLoginUser()
    })
    
    return { router };
  },
});
</script>

<style>
#app {
  font-family: Avenir, Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-align: center;
  color: #2c3e50;
  margin-top: 60px;
}
</style>
